import request from '@/axios'
import type { ListParams, Response } from '@/api/api'

export interface Row {
  id: number
  real_name: string
  password: string
  mobile: string
  user_name: string
}

export interface FormData {
  id?: number
  real_name: string
  password: string
  mobile: string
  user_name: string
}
// 账号列表
export const getListApi = (data: ListParams): Promise<Response<Row>> => {
  return request.post({ url: '/user/list', data })
}
// 账号列表新增
export const createApi = (data: Partial<FormData>): Promise<IResponse> => {
  return request.post({ url: '/user/create', data })
}
// 账号列表编辑
export const modifyApi = (data: Partial<FormData>): Promise<IResponse> => {
  return request.post({ url: '/user/modify', data })
}
// 账号列表删除
export const delUserApi = (data: { id: string }): Promise<IResponse> => {
  return request.post({ url: '/user/del', data })
}
